import Taro, {Component} from '@tarojs/taro'
import {View, Button, Text, Swiper, SwiperItem, Image, ScrollView} from '@tarojs/components'
import {connect} from '@tarojs/redux'
import {
  set_userinfo, set_cart, set_goodslist, set_viplist, set_bind_car_num, set_progress,
  set_pushdata, set_pushdatanum, gohome_btn, set_cart_num,
} from '../../actions/IndexAction'
import base from "../base"
import {AtTabs, AtTabsPane, AtSearchBar} from 'taro-ui'
import './index.less'
import set from "../../apis/api"

class jz_info extends Component {
  constructor(props) {
    super(props)
    base(this)
    this.state = {
      current: 0,
      value: ""
    }
  }

  config = {
    navigationBarTitleText: '基站首页',
    enablePullDownRefresh: true,
    navigationBarBackgroundColor: "#4bb33d",
    navigationBarTextStyle: "white"

  }

  onReachBottom() {


  }


  componentWillReceiveProps(nextProps) {
    console.log(this.props, nextProps)
  }

  onPullDownRefresh() {
    wx.stopPullDownRefresh();
  }

  componentWillUnmount() {
  }

  componentDidShow() {
    this.onPullDownRefresh()


  }

  back() {
    Taro.navigateBack()
  }

  fetchData() {


    // wx.showLoading({title: "加载中"})
    // var databody={
    //   openid:this.props.wxuser.wxuser.openid,
    //   id:this.$router.params.id
    // }
    // this.wx_request(set.oto.getotoorder, databody,"POST", {'Content-Type': 'application/x-www-form-urlencoded'}).then((data)=>
    // {
    //
    //
    //   wx.stopPullDownRefresh();
    //   wx.hideLoading();
    //
    // }).catch((err)=>{
    //   wx.hideLoading();
    //   wx.stopPullDownRefresh();
    //   wx.showToast({
    //     title: '网络访问失败，请重试',
    //     icon: 'none',
    //     duration: 1800
    //   })
    // })

  }

  componentDidHide() {
  }

  render() {
    return (
      <View style={{flex: 1, background: "#cccccc"}}>
        <ScrollView>
          <View style={{display: "flex", flexDirection: "column", alignItems: "center", paddingBottom: "150rpx"}}>
            <View style={{height: "150rpx"}}>

            </View>
            <View style={{display: "flex", width: "90%", justifyContent: "center"}}>
              <View
                style={{
                  background: "rgba(0,0,0,0.3)",
                  flex: 1,
                  margin: "20rpx",
                  borderRadius: "20rpx",
                  height: "200rpx"
                }}>
                <View style={{display: "flex", alignItems: "center", padding: "10rpx"}}>
                  <Text style={{fontSize: "36rpx", color: "#ffffff"}}>
                    电流
                  </Text>
                </View>
                <View style={{display: "flex", justifyContent: "center", flex: 1, alignItems: "center"}}>
                  <View style={{display: "flex", alignItems: "flex-end", height: "100rpx"}}>
                    <View style={{display: "flex",}}>
                      <Text style={{fontSize: "80rpx", color: "#ffffff"}}>
                        4.5
                      </Text>
                    </View>
                    <View
                      style={{display: "flex", alignItems: "flex-end", paddingBottom: "10rpx", paddingLeft: "10rpx"}}>
                      <Text style={{fontSize: "24rpx", color: "#ffffff"}}>
                        A
                      </Text>
                    </View>
                  </View>
                </View>

              </View>
              <View
                style={{
                  background: "rgba(0,0,0,0.3)",
                  flex: 1,
                  margin: "20rpx",
                  borderRadius: "20rpx",
                  height: "200rpx"
                }}>
                <View style={{display: "flex", alignItems: "center", padding: "10rpx"}}>
                  <Text style={{fontSize: "36rpx", color: "#ffffff"}}>
                    电流
                  </Text>
                </View>
                <View style={{display: "flex", justifyContent: "center", flex: 1, alignItems: "center"}}>
                  <View style={{display: "flex", alignItems: "flex-end", height: "100rpx"}}>
                    <View style={{display: "flex",}}>
                      <Text style={{fontSize: "80rpx", color: "#ffffff"}}>
                        4.5
                      </Text>
                    </View>
                    <View
                      style={{display: "flex", alignItems: "flex-end", paddingBottom: "10rpx", paddingLeft: "10rpx"}}>
                      <Text style={{fontSize: "24rpx", color: "#ffffff"}}>
                        A
                      </Text>
                    </View>
                  </View>
                </View>

              </View>
              <View
                style={{
                  background: "rgba(0,0,0,0.3)",
                  flex: 1,
                  margin: "20rpx",
                  borderRadius: "20rpx",
                  height: "200rpx"
                }}>
                <View style={{display: "flex", alignItems: "center", padding: "10rpx"}}>
                  <Text style={{fontSize: "36rpx", color: "#ffffff"}}>
                    电流
                  </Text>
                </View>
                <View style={{display: "flex", justifyContent: "center", flex: 1, alignItems: "center"}}>
                  <View style={{display: "flex", alignItems: "flex-end", height: "100rpx"}}>
                    <View style={{display: "flex",}}>
                      <Text style={{fontSize: "80rpx", color: "#ffffff"}}>
                        4.5
                      </Text>
                    </View>
                    <View
                      style={{display: "flex", alignItems: "flex-end", paddingBottom: "10rpx", paddingLeft: "10rpx"}}>
                      <Text style={{fontSize: "24rpx", color: "#ffffff"}}>
                        A
                      </Text>
                    </View>
                  </View>
                </View>

              </View>
            </View>
            <View style={{display: "flex", flexDirection: "column", alignItems: "center"}}>
              <View style={{display: "flex"}}>
                <View style={{height:"70rpx",width:"200rpx",display:"flex",alignItems:"center",justifyContent:"center",background:"#00a0ea",borderRadius:"20rpx",margin:"20rpx"}}>

                  <Text style={{fontSize:"26rpx",color:"#ffffff"}}>
                    设备管理
                  </Text>

                </View>
                <View style={{height:"70rpx",width:"200rpx",display:"flex",alignItems:"center",justifyContent:"center",background:"#f9b552",borderRadius:"20rpx",margin:"20rpx"}}>

                  <Text style={{fontSize:"26rpx",color:"#ffffff"}}>
                    基站详情
                  </Text>

                </View>
              </View>
              <View style={{flex: 1, display: "flex", flexDirection: "column"}}>
                <View
                  style={{
                  height: "180rpx",
                  background: "#ffffff",
                  borderRadius: "20rpx",
                  margin: "20rpx",
                  display: "flex",
                  width: "85vw"
                }}>
                  <View style={{width: "180rpx"}}>

                  </View>

                  <View style={{flex: 1, display: "flex", flexDirection: "column", justifyContent: "center"}}>
                    <View>
                      <Text style={{fontSize: "26rpx", color: "#333333"}}>
                        空调设备
                      </Text>
                    </View>
                    <View style={{marginTop: "20rpx"}}>
                      <Text style={{fontSize: "24rpx", color: "#333333"}}>
                        运行状态:
                      </Text>
                      <Text style={{fontSize: "24rpx", color: "#4bb33d", marginLeft: "10rpx"}}>
                        正常运行
                      </Text>
                    </View>
                  </View>
                </View>
                <View
                  style={{
                    height: "180rpx",
                    background: "#ffffff",
                    borderRadius: "20rpx",
                    margin: "20rpx",
                    display: "flex",
                    width: "85vw"
                  }}>
                  <View style={{width: "180rpx"}}>

                  </View>

                  <View style={{flex: 1, display: "flex", flexDirection: "column", justifyContent: "center"}}>
                    <View>
                      <Text style={{fontSize: "26rpx", color: "#333333"}}>
                        空调设备
                      </Text>
                    </View>
                    <View style={{marginTop: "20rpx"}}>
                      <Text style={{fontSize: "24rpx", color: "#333333"}}>
                        运行状态:
                      </Text>
                      <Text style={{fontSize: "24rpx", color: "#4bb33d", marginLeft: "10rpx"}}>
                        正常运行
                      </Text>
                    </View>
                  </View>
                </View>
                <View
                  style={{
                    height: "180rpx",
                    background: "#ffffff",
                    borderRadius: "20rpx",
                    margin: "20rpx",
                    display: "flex",
                    width: "85vw"
                  }}>
                  <View style={{width: "180rpx"}}>

                  </View>

                  <View style={{flex: 1, display: "flex", flexDirection: "column", justifyContent: "center"}}>
                    <View>
                      <Text style={{fontSize: "26rpx", color: "#333333"}}>
                        空调设备
                      </Text>
                    </View>
                    <View style={{marginTop: "20rpx"}}>
                      <Text style={{fontSize: "24rpx", color: "#333333"}}>
                        运行状态:
                      </Text>
                      <Text style={{fontSize: "24rpx", color: "#4bb33d", marginLeft: "10rpx"}}>
                        正常运行
                      </Text>
                    </View>
                  </View>
                </View>
                <View
                  style={{
                    height: "180rpx",
                    background: "#ffffff",
                    borderRadius: "20rpx",
                    margin: "20rpx",
                    display: "flex",
                    width: "85vw"
                  }}>
                  <View style={{width: "180rpx"}}>

                  </View>

                  <View style={{flex: 1, display: "flex", flexDirection: "column", justifyContent: "center"}}>
                    <View>
                      <Text style={{fontSize: "26rpx", color: "#333333"}}>
                        空调设备
                      </Text>
                    </View>
                    <View style={{marginTop: "20rpx"}}>
                      <Text style={{fontSize: "24rpx", color: "#333333"}}>
                        运行状态:
                      </Text>
                      <Text style={{fontSize: "24rpx", color: "#4bb33d", marginLeft: "10rpx"}}>
                        正常运行
                      </Text>
                    </View>
                  </View>
                </View>
                <View
                  style={{
                    height: "180rpx",
                    background: "#ffffff",
                    borderRadius: "20rpx",
                    margin: "20rpx",
                    display: "flex",
                    width: "85vw"
                  }}>
                  <View style={{width: "180rpx"}}>

                  </View>

                  <View style={{flex: 1, display: "flex", flexDirection: "column", justifyContent: "center"}}>
                    <View>
                      <Text style={{fontSize: "26rpx", color: "#333333"}}>
                        空调设备
                      </Text>
                    </View>
                    <View style={{marginTop: "20rpx"}}>
                      <Text style={{fontSize: "24rpx", color: "#333333"}}>
                        运行状态:
                      </Text>
                      <Text style={{fontSize: "24rpx", color: "#4bb33d", marginLeft: "10rpx"}}>
                        正常运行
                      </Text>
                    </View>
                  </View>
                </View>
              </View>


            </View>
          </View>


        </ScrollView>
      </View>
    )
  }
}

const mapstate = state => {
  return {
    userinfo: state.usermodel,
    cart_num: state.cart_num,
    cart: state.cart,
    goodslist: state.goodslist,
    vip: state.vip,
    progress: state.progress,
    pushdata: state.pushdata,
    wxuser: state.wxusermodel,sys_config:state.sys_config
  }
}
export default connect(mapstate)(jz_info)

